package com.android.common;

import android.app.Application;
import android.content.Context;

public class ApplicationCommon extends Application {
	protected static ApplicationCommon mInstance;

	@Override
	public void onCreate() {
		super.onCreate();
		mInstance = this;
		App.init(this);// 初始化系统变量
	}

	public static ApplicationCommon getInstance() {
		return mInstance;
	}

	public Context getCurrentContext() {
		return ActivityManager.getInstance().getCurrentContext();
	}

	public String getCurrentContextName() {
		return ActivityManager.getInstance().getCurrentContextName();
	}

	public void setCurrentContext(Context context) {
		ActivityManager.getInstance().setCurrentContext(context);
	}

	public static void destory() {
		App.destory();
		android.os.Process.killProcess(android.os.Process.myPid());
	}

}
